package com.itita.ww2.handler.requesthandler.worldmap;

import java.sql.SQLException;

import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.data.ISFSArray;
import com.smartfoxserver.v2.entities.data.ISFSObject;
import com.smartfoxserver.v2.entities.data.SFSObject;
import com.itita.ww2.core.MessageHandler;
import com.itita.ww2.core.WW2Exception;
import com.itita.ww2.game.worldmap.WorldMapService;
import com.itita.ww2.utils.handler.IRequestOper;

/**
 * 获取城市内据点列表及其当前状态
 * @author NorthLan
 *
 */
public class GetCityBaseList implements IRequestOper {

	@Override
	public boolean execute(String requestCMD, User user, ISFSObject params) throws WW2Exception, SQLException {
		int blockId = params.getInt("blockId");
		int cityId = params.getInt("cityId");
		ISFSArray resultArr = WorldMapService.getCityBaseList(blockId, cityId);

		ISFSObject backObj = SFSObject.newInstance();
		backObj.putSFSArray("data", resultArr);
		MessageHandler.getInstance().sendMsg(requestCMD, backObj, user, null, true);
		return true;
	}

}
